package spring.demo.entity;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;

import java.io.Serializable;

public class Student implements Serializable {

    private String SNO;
    private String SNAME;
    private String SSEX;
    private String SBIRTHDAY;
    private String CLASS;

    public String getSNO() {
        return SNO;
    }

    public void setSNO(String SNO) {
        this.SNO = SNO;
    }

    public String getSNAME() {
        return SNAME;
    }

    public void setSNAME(String SNAME) {
        this.SNAME = SNAME;
    }

    public String getSSEX() {
        return SSEX;
    }

    public void setSSEX(String SSEX) {
        this.SSEX = SSEX;
    }

    public String getSBIRTHDAY() {
        return SBIRTHDAY;
    }

    public void setSBIRTHDAY(String SBIRTHDAY) {
        this.SBIRTHDAY = SBIRTHDAY;
    }

    public String getCLASS() {
        return CLASS;
    }

    public void setCLASS(String CLASS) {
        this.CLASS = CLASS;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;

        if (o == null || getClass() != o.getClass()) return false;

        Student student = (Student) o;

        return new EqualsBuilder()
                .append(SNO, student.SNO)
                .append(SNAME, student.SNAME)
                .append(SSEX, student.SSEX)
                .append(SBIRTHDAY, student.SBIRTHDAY)
                .append(CLASS, student.CLASS)
                .isEquals();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder(17, 37)
                .append(SNO)
                .append(SNAME)
                .append(SSEX)
                .append(SBIRTHDAY)
                .append(CLASS)
                .toHashCode();
    }
}
